package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by kashyapk on 05/03/14.
 */
public abstract class Menu {
    protected final Library library;
    protected final Customer customer;
    protected static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


    public Menu(Library library, Customer customer) {
        this.library = library;
        this.customer = customer;
    }

    abstract void ShowMenu();
    abstract int MenuAction(int choice);

    public int MenuSelect() {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int choice = 0;
        try {
            choice = Integer.parseInt(br.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
        if(choice > 3 || choice < 1)
            return -1;
        return choice;
    }
}
